import os
from openai import OpenAI

class ArkEmbeddingModel:
    def __init__(self):
        self.embedding = OpenAI(
            base_url=os.getenv('ARK_EMBEDDING_URL'),
            api_key=os.getenv('ARK_BASE_KEY')
        )

    def embed_documents(self, value: str):
        result = self.embedding.embeddings.create(
            model=os.getenv('ARK_EMBEDDING_MODEL_NAME'),
            input=value[:4096]
        )
        return result.data[0].embedding